package org.lhg.activiti.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.lhg.activiti.mapper.UserMapper;
import org.lhg.activiti.model.User;
import org.lhg.activiti.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
@Transactional
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements UserService {
    @Autowired
    private UserMapper userMapper;
    @Override
    public Map<String, String> getUserList() {
        Map<String, String> map=new HashMap<String, String>();
        List<User> userList=userMapper.getUserList();
        for (User user:userList) {
            map.put(user.getId(),user.getFirstName()+user.getLastName());
        }
        return map;
    }
}
